
//lib/app/bean/bean_video.dart
//视频数据模型
class VideoModel {
  //视频名称
  String videoName = '';
  String videoInfo = "";
  String videoHtmlUrl = "";

  //视频链接
  String videoUrl = '';

  //视频截图
  String videoImag = '';

  //是否关注
  bool isAttention = false;

  //关注的个数
  num attentCount = 0;

  //是否喜欢
  bool isLike = false;

  //点赞的个数
  num pariseCount = 0;

  //分享的次数
  num shareCount = 0;
  String createTime;

  int id;
  int videoCourseId;

  // 课件类型 0 视频 1 PPT 2 Word
  int videoTypes;

  int totalHourse = 0;
  int totalMinute = 0;
  int totalSecond = 0;

  int videoSecond = 0;

  ///视频状态  1 进行中  2已完成
  int userStatues = -1;

  /// 完成的百分比
  String finishPercent = "";

  //空构造函数
  VideoModel();

  //常用用于解析JSON数据
  VideoModel.fromMap(Map<String, dynamic> map) {
    this.id = map["id"];
    this.videoName = map["videoName"];
    this.videoInfo = map["videoInfo"];
    this.videoUrl = map["videoUrl"];
    this.videoImag = map["videoImag"];
    this.isAttention = map["isAttention"] ?? false;
    this.videoHtmlUrl = map["videoHtmlUrl"] ?? "";

    this.videoCourseId = map["videoCourseId"];
    this.videoTypes = map["videoTypes"];

    this.userStatues = map["userStatues"] ?? -1;
    this.finishPercent = map["finishPercent"] ?? "";

    this.videoSecond = map["videoSecond"] ?? 0;
    this.totalHourse = map["totalHourse"] ?? 0;
    this.totalMinute = map["totalMinute"] ?? 0;
    this.totalSecond = map["totalSecond"] ?? 0;

    this.attentCount = map["attentCount"];
    this.isLike = map["isLike"] ?? false;
    this.pariseCount = map["pariseCount"];
    this.shareCount = map["shareCount"];
    this.createTime = map["createTime"];
  }

  @override
  String toString() {
    return 'VideoModel{videoName: $videoName, videoUrl: $videoUrl, videoImag: $videoImag, isAttention: $isAttention, attentCount: $attentCount, isLike: $isLike, pariseCount: $pariseCount, shareCount: $shareCount, createTime: $createTime, id: $id, videoCourseId: $videoCourseId, videoTypes: $videoTypes}';
  }
}
